home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 1 / Cream of the Crop 1.iso / WINDOWS / DR6WIN.ARJ / UPDATE.BAT < prev    next >
DOS Batch File  |  1991-04-07  |  6KB  |  238 lines

  1. @echo off
  2. if not "%OS%" == "DRDOS" goto error4
  3. if not "%VER%" == "6.0" goto error4
  4.  
  5. echo UPDATE R3.01  DR DOS File Update Utility
  6. echo Copyright (c) 1990,1991 Digital Research Inc. All rights reserved.
  7.  
  8. if "%1" == "/H" goto showhelp
  9. if "%1" == "/h" goto showhelp
  10. if "%1" == "/?" goto showhelp
  11. if "%1" == "" goto showhelp
  12.  
  13. set SYSDRV=0123456789012345678901234567890123456789
  14. if not "%SYSDRV%" == "0123456789012345678901234567890123456789" goto error2
  15. set SYSDRV=
  16.  
  17. if "%1"=="a:" set SYSDRV=A:
  18. if "%1"=="A:" set SYSDRV=A:
  19. if "%1"=="b:" set SYSDRV=B:
  20. if "%1"=="B:" set SYSDRV=B:
  21. if "%1"=="c:" set SYSDRV=C:
  22. if "%1"=="C:" set SYSDRV=C:
  23. if "%SYSDRV%" == "" goto error3
  24. set SWCH=/r
  25.  
  26. if "%SYSDRV%" == "A:" goto floppy
  27. if "%SYSDRV%" == "B:" goto floppy
  28.  
  29. set SYSDIR=DRDOS
  30. goto hard
  31.  
  32. :floppy
  33. echo  
  34. echo Updating files for a floppy based system on drive %SYSDRV%
  35. echo  
  36.  
  37. :loop0
  38. set DISKNAME=STARTUP
  39. set IDFILE=command.com
  40. gosub insert_disk
  41. gosub update_files
  42. if exist %SYSDRV%\install.exe copy util\setup.exe %SYSDRV%\install.exe >NUL
  43.  
  44. set DSKTYPE=360
  45. if exist %SYSDRV%\emm386.sys set DSKTYPE=720
  46. if exist %SYSDRV%\lock.exe   set DSKTYPE=1.2/1.44
  47.  
  48. if "%DSKTYPE%" == "1.2/1.44" goto vmax_disk
  49.  
  50. set DISKNAME=UTILITITES-1
  51. set IDFILE=emm386.sys
  52. if "%DSKTYPE%" == "720" set IDFILE=editor.exe
  53. gosub insert_disk
  54. gosub update_files
  55. if exist %SYSDRV%\install.exe copy util\setup.exe %SYSDRV%\install.exe >NUL
  56.  
  57. set DISKNAME=UTILITITES-2
  58. set IDFILE=mem.exe
  59. if "%DSKTYPE%" == "720" set IDFILE=sstor.exe
  60. gosub insert_disk
  61. gosub update_files
  62.  
  63. if "%DSKTYPE%" == "720" goto vmax_disk
  64.  
  65. set DISKNAME=UTILITITES-3
  66. set IDFILE=lock.exe
  67. gosub insert_disk
  68. gosub update_files
  69.  
  70. set DISKNAME=UTILITITES-4
  71. set IDFILE=print.com
  72. gosub insert_disk
  73. gosub update_files
  74.  
  75. set DISKNAME=UTILITITES-5
  76. set IDFILE=recover.com
  77. gosub insert_disk
  78. gosub update_files
  79.  
  80. :vmax_disk
  81. set DISKNAME=VIEWMAX
  82. set IDFILE=viewmax.exe
  83. gosub insert_disk
  84. gosub update_files
  85.  
  86. :floppyend
  87. if not exist update.1 goto success
  88. gosub swap_disk
  89. goto loop0
  90.  
  91. :hard
  92. if "%2" == "" goto skip1
  93. if "%2" == "/S" goto repall
  94. if "%2" == "/s" goto repall
  95. set SYSDIR=%2
  96. if "%SYSDIR%" == "\" set SYSDIR=.
  97.  
  98. :skip3
  99. if "%3" == "/S" goto repall
  100. if "%3" == "/s" goto repall
  101. goto skip1
  102.  
  103. :repall
  104. set SWCH=/r /s
  105. set SYSDIR=.
  106. echo  
  107. echo WARNING: You have specified to update all copies of the relevant files
  108. echo on drive %SYSDRV%. UPDATE will NOT check if the files are DR DOS files.
  109. goto skip2
  110.  
  111. :skip1
  112. echo  
  113. if "%SYSDIR%" == "." echo Updating DR DOS files on drive %SYSDRV%
  114. if not "%SYSDIR%" == "." echo Updating DR DOS files in directory %SYSDIR% on drive %SYSDRV%
  115. :skip2
  116. echo  
  117. echo Press CTRL-C now if this is not correct and enter UPDATE /H for more
  118. echo information.
  119. echo  
  120. pause
  121.  
  122. if "%SYSDIR%" == "." goto skiptest
  123. if not exist %SYSDRV%\%SYSDIR%\hidos.sys goto error
  124. :skiptest
  125.  
  126. rem ** determine if there's a swapped sstor drive
  127. rem ** this will result in SET SWAPDRV=NONE or SET SWAPDRV=d:
  128. sstorchk
  129.  
  130. :loop1
  131. echo Updating files...
  132. replace @util.fl %SYSDRV%\%SYSDIR% %SWCH% >NUL
  133. replace @sys.fl  %SYSDRV%\ /r /h >NUL
  134. if not exist sys\command.com goto skip_cmd
  135. if not exist %COMSPEC% goto skip_cmd
  136. copy sys\command.com %COMSPEC% >nul
  137. :skip_cmd
  138.  
  139. if "%SWAPDRV%" == "NONE" goto almost
  140. replace @util.fl %SWAPDRV%\%SYSDIR% %SWCH% >NUL
  141. replace @sys.fl  %SWAPDRV%\ /r /h >NUL
  142.  
  143. :almost
  144. if not exist update.1 goto success
  145. gosub swap_disk
  146. goto loop1
  147.  
  148. :success
  149. echo  
  150. echo UPDATE completed successfully.
  151. goto exit
  152.  
  153. :insert_disk
  154. echo Insert either your master %DISKNAME% disk or your
  155. echo working %DISKNAME% disk in drive %SYSDRV%
  156. echo If it is the master disk ensure the physical write protection is removed.
  157. echo  
  158. pause
  159. if exist %SYSDRV%\%IDFILE% return
  160. echo ERROR: Wrong disk in drive %SYSDRV%
  161. echo  
  162. goto insert_disk
  163.  
  164.  
  165. :update_files
  166. echo Updating files...
  167. replace @util.fl %SYSDRV% /r >NUL
  168. replace @sys.fl %SYSDRV% /r /h >NUL
  169. echo  
  170. return
  171.  
  172. :swap_disk
  173. echo Insert Update Disk #2
  174. echo  
  175. pause
  176. if exist update.2 return
  177. echo ERROR: Wrong Update Disk in drive %SYSDRV%
  178. echo  
  179. goto swap_disk
  180.  
  181.  
  182. :update_files
  183. :error
  184. echo  
  185. echo ERROR:  The drive/directory specified does not contain DR DOS files.
  186. echo  
  187. goto exit
  188.  
  189. :error2
  190. echo  
  191. echo ERROR:  There is insufficient environment space to run this batch file.
  192. echo         Increase the environment space and try again.
  193. echo  
  194. goto exit
  195.  
  196. :error3
  197. echo  
  198. echo ERROR:  Invalid drive specifier. Enter UPDATE /H for more information.
  199. echo  
  200. goto exit
  201.  
  202. :error4
  203. echo  
  204. echo ERROR:  Incompatible operating system. Update requires DR DOS 6.0.
  205. echo  
  206. goto exit
  207.  
  208. :showhelp
  209. echo  
  210. echo UPDATE will replace DR DOS files on your hard disk or floppy disks with the
  211. echo updated versions contained on this floppy disk.
  212. echo  
  213. echo UPDATE d: [directory] [/S]
  214. echo  
  215. echo d:         Drive to update. (A: B: or C:)
  216. echo directory  Directory where DR DOS files are located.
  217. echo /S         Update all copies of the relevant files on the hard disk specified.
  218. echo            WARNING: This option DOES NOT check that the files being updated
  219. echo            are DR DOS files.
  220. echo  
  221. echo For example UPDATE C: OSFILES will cause the files in the directory C:\OSFILES
  222. echo to be updated.
  223. echo  
  224. echo If you specify a floppy drive UPDATE will prompt you for each disk as it is
  225. echo required. The disks can be either the master disks or your working disks if
  226. echo if you have a twin drive floppy based system.
  227. echo   
  228.  
  229. :exit
  230. rem set SYSDRV=
  231. rem set SYSDIR=
  232. rem set SET720=
  233. rem set SWCH=
  234. rem set SWAPDRV=
  235. rem set DISKNAME=
  236. rem set IDFILE=
  237. rem set DSKTYPE=
  238.